{% load i18n %}
{% if archiveList %}
<script type="text/javascript">
    function showArchivedBlogs(obj) {
        var archive_value = obj[obj.selectedIndex].value;
        window.location.href = "/archive/" + archive_value;
    }
</script>
<div id="archives">
    <h3>{% trans "Archives" %}</h3>
    <ul>
        <li>
        {% if archiveList %}
        <select onchange="showArchivedBlogs(this)">
        {% for archive in archiveList %}
        <option value='{{archive.monthyear|replace:" -"}}' {% if monthyear %}{% ifequal  monthyear archive.monthyear %}selected{% endifequal %}{%endif%}>{{ archive.monthyear }} ({{archive.weblogcount}})
        </option>
        {% endfor %}
        </select>
        {% endif %}
        </li>
    </ul>
</div>
{% endif %}
